package com.itheima.homework.homework06;

import java.util.Calendar;

public class Test06 {
    public static void main(String[] args) {
        Calendar c = Calendar.getInstance();
        // 获取年份
        int year = c.get(Calendar.YEAR);
        /*
        	-----获取月日并输出-----
        */
        System.out.println("获取到的年份为：" + year);

        int month = c.get(Calendar.MONTH);
        System.out.println("获取到的月份为：" + (month + 1));

        int day = c.get(Calendar.DATE);
        System.out.println("获取到的日为：" + day);
    }
}
